import request from '@/utils/request'

// 线索信息管理
export function getClueList(params) {
  return request({
    url: '/api/flow/clues',
    method: 'GET',
    params
  })
}

export function getClueListByParentIdAndDayBetween(params) {
  return request({
    url: '/api/flow/clues/getByParentId',
    method: 'GET',
    params
  })
}

export function createClue(clue) {
  return request({
    url: '/api/flow/clues',
    method: 'POST',
    data: clue
  })
}

export function updateClue(clue) {
  return request({
    url: '/api/flow/clues/' + clue.id,
    method: 'PUT',
    data: clue
  })
}

export function deleteClue(id) {
  return request({
    url: '/api/flow/clues/' + id,
    method: 'DELETE'
  })
}

export function getClueAlertList(params) {
  return request({
    url: '/api/flow/clue/alerts',
    method: 'GET',
    params
  })
}

export function getCluePeriodStats(params) {
  return request({
    url: '/api/flow/clue/stats/period',
    method: 'GET',
    params
  })
}

export function getClueAmountOverview(params) {
  return request({
    url: '/api/flow/clue/stats/amount/overview',
    method: 'GET',
    params
  })
}

export function getClueAmountOverviewGroupByOrg(params) {
  return request({
    url: '/api/flow/clue/stats/amount/overviewGroupByOrg',
    method: 'GET',
    params
  })
}

export function getClueAmountGroupByOrg() {
  return request({
    url: '/api/flow/clue/stats/amount/groupByOrg',
    method: 'GET'
  })
}

export function getClueAmountTrend() {
  return request({
    url: '/api/flow/clue/stats/amount/trend',
    method: 'GET'
  })
}

export function getClueAlertBrief() {
  return request({
    url: '/api/flow/clue/alerts/brief',
    method: 'GET'
  })
}
